package com.jams.goodox.entity;

import com.jams.goodox.net.BaseEntity;
import com.jams.goodox.utils.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 私信列表
 * Created by hgz on 2016/6/3.
 */
public class MessagePrivateListBean extends BaseEntity{
    private DataBean data;

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean implements Mapper<List<MessageBean>>{
        private PageInfoBean pageInfo;

        private List<ResultListBean> resultList;

        public PageInfoBean getPageInfo() {
            return pageInfo;
        }

        public void setPageInfo(PageInfoBean pageInfo) {
            this.pageInfo = pageInfo;
        }

        public List<ResultListBean> getResultList() {
            return resultList;
        }

        public void setResultList(List<ResultListBean> resultList) {
            this.resultList = resultList;
        }

        @Override
        public List<MessageBean> transform() {
            List<MessageBean> messageBeanList=new ArrayList<>();
            if(resultList!=null&&resultList.size()>0){
                for(ResultListBean resultListBean:resultList){
                    messageBeanList.add(resultListBean.transform());
                }
            }
            return messageBeanList;
        }

        public static class ResultListBean implements Mapper<MessageBean>{
            private String msgContent;
            private String num;
            private String headPicName;
            private String msgTheme;
            private String msgId;
            private String time;
            private String userName;
            private String updatetime;
            private String userId;

            public String getMsgContent() {
                return msgContent;
            }

            public void setMsgContent(String msgContent) {
                this.msgContent = msgContent;
            }

            public String getNum() {
                return num;
            }

            public void setNum(String num) {
                this.num = num;
            }

            public String getHeadPicName() {
                return headPicName;
            }

            public void setHeadPicName(String headPicName) {
                this.headPicName = headPicName;
            }

            public String getMsgTheme() {
                return msgTheme;
            }

            public void setMsgTheme(String msgTheme) {
                this.msgTheme = msgTheme;
            }

            public String getMsgId() {
                return msgId;
            }

            public void setMsgId(String msgId) {
                this.msgId = msgId;
            }

            public String getTime() {
                return time;
            }

            public void setTime(String time) {
                this.time = time;
            }

            public String getUserName() {
                return userName;
            }

            public void setUserName(String userName) {
                this.userName = userName;
            }

            public String getUpdatetime() {
                return updatetime;
            }

            public void setUpdatetime(String updatetime) {
                this.updatetime = updatetime;
            }

            public String getUserId() {
                return userId;
            }

            public void setUserId(String userId) {
                this.userId = userId;
            }

            @Override
            public MessageBean transform() {
                MessageBean messageBean=new MessageBean();
                messageBean.setInfoTitle(userName);
                messageBean.setInfoIcon(headPicName);
                messageBean.setInfoNum(Utils.getIntByStr(num));
                messageBean.setInfoEntime(updatetime);
                messageBean.setUserId(userId);
                messageBean.setInfoHint(msgContent);
                return messageBean;
            }
        }
    }
}
